//
// Created by DMC on 2024/5/11.
//

// 单例模式
#include <iostream>
#include <mutex>
#include <memory>
#include <thread>
#include <chrono>

class Singleton {
private:
    Singleton() { }
    Singleton(const Singleton &) = delete;
    Singleton(const Singleton &&) = delete;
    Singleton &operator=(const Singleton &) = delete;

public:
    static Singleton &getInstance() {
        static Singleton s;
        return s;
    }

public:
    void show() {
        std::cout << "This is a singleton!" << std::endl;
    }
};

